package com.ruoyi.common.enums;



public enum ActivityTypeEnum {
    //8种行为 进港、离港、正常、{停靠、加速、减速、失联、追踪中断}
    DATA_1(1, "进港","ok"),
    DATA_2(2, "离港","ok"),
    DATA_3(3, "正常","ok"),
    DATA_4(4, "停靠","no"),
    DATA_5(5, "加速","no"),
    DATA_6(6, "减速","no"),
    DATA_7(7, "失联","no"),
    DATA_8(8, "追踪中断","no"),

    //引接:锚泊---停靠
    //引接:在航---正常
    //引接:操纵受限---正常
    //引接:靠泊---进港
    //引接:未定义---正常
    DATA_9(4, "锚泊","no"),
    DATA_10(3, "在航","no"),
    DATA_11(3, "操纵受限","no"),
    DATA_12(1, "靠泊","ok"),
    DATA_13(3, "未定义","no");

    private Integer code;
    private String desc;
    private String flag;

    ActivityTypeEnum(Integer code, String desc, String flag) {
        this.code = code;
        this.desc = desc;
        this.flag = flag;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public static ActivityTypeEnum getEnum(Integer code) {
        for (ActivityTypeEnum enums : ActivityTypeEnum.values()) {
            if (enums.getCode().equals(code)) {
                return enums;
            }
        }
        return null;
    }

    public static Integer getCode(String desc) {
        for (ActivityTypeEnum enums : ActivityTypeEnum.values()) {
            if (enums.getDesc().equals(desc)) {
                return enums.getCode();
            }
        }
        return ActivityTypeEnum.DATA_3.getCode();
    }

}
